home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / libs / kpathsea / xstat.c < prev    next >
C/C++ Source or Header  |  1995-06-25  |  1KB  |  53 lines

  1. /* xstat.c: stat and (maybe) lstat with error checking.
  2.  
  3. Copyright (C) 1992, 93 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */
  18.  
  19. #include <kpathsea/config.h>
  20.  
  21. #include <kpathsea/xstat.h>
  22.  
  23.  
  24. struct stat
  25. xstat P1C(const_string, path)
  26. {
  27.   struct stat s;
  28.   
  29.   if (stat (path, &s) != 0)
  30.     FATAL_PERROR (path);
  31.   
  32.   return s;
  33. }
  34.  
  35.  
  36. /* If we don't have symbolic links, lstat is the same as stat, and
  37.    a #define is made in the include file.  We declare lstat to avoid an
  38.    implicit declaration warning for development; sigh.  */
  39.  
  40. #ifdef S_ISLNK
  41. extern int lstat ();
  42. struct stat
  43. xlstat P1C(const_string, path)
  44. {
  45.   struct stat s;
  46.   
  47.   if (lstat (path, &s) != 0)
  48.     FATAL_PERROR (path);
  49.   
  50.   return s;
  51. }
  52. #endif
  53.